import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysGroupInfo = (params) => {
  params.head.transCode = 'querySysGroupInfo';
  return request({
    url: '/platform/sysGroupInfo/querySysGroupInfo',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysGroupInfoListPage = (params) => {
  params.head.transCode = 'querySysGroupInfoListPage';
  return request({
    url: '/platform/sysGroupInfo/querySysGroupInfoListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysGroupInfo = (params) => {
  params.head.transCode = 'saveSysGroupInfo';
  return request({
    url: '/platform/sysGroupInfo/saveSysGroupInfo',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysGroupInfoList = (params) => {
  params.head.transCode = 'saveSysGroupInfoList';
  return request({
    url: '/platform/sysGroupInfo/saveSysGroupInfoList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysGroupInfo = (params) => {
  params.head.transCode = 'saveOrUpdateSysGroupInfo';
  return request({
    url: '/platform/sysGroupInfo/saveOrUpdateSysGroupInfo',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysGroupInfoList = (params) => {
  params.head.transCode = 'saveOrUpdateSysGroupInfoList';
  return request({
    url: '/platform/sysGroupInfo/saveOrUpdateSysGroupInfoList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysGroupInfo = (params) => {
  params.head.transCode = 'updateSysGroupInfo';
  return request({
    url: '/platform/sysGroupInfo/updateSysGroupInfo',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysGroupInfo = (params) => {
  params.head.transCode = 'deleteSysGroupInfo';
  return request({
    url: '/platform/sysGroupInfo/deleteSysGroupInfo',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysGroupInfoList = (params) => {
  params.head.transCode = 'deleteSysGroupInfoList';
  return request({
    url: '/platform/sysGroupInfo/deleteSysGroupInfoList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysGroupInfoExcel = (params) => {
  downloadExcel({
    url: '/platform/sysGroupInfo/excelDownload/exportSysGroupInfoExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
